<template>
    <el-form ref="ruleForm" :model="data" status-icon :rules="rules" class="demo-ruleForm">

        <el-form-item label="商品名" prop="name">
            <el-input placeholder="请输入商品名" v-model="data.name" />
        </el-form-item>

        <el-form-item label="商品分类" prop="category">
            <el-select v-model="data.category" placeholder="请选择分类">
                <el-option label="千万销量" value="category" />
                <!-- <el-option label="营养适配" value="normal" /> -->
            </el-select>
        </el-form-item>

        <!-- <el-form-item label="商品价格" prop="price">
            <el-input-number v-model="data.price" :min="1" :max="10" label="描述文字"></el-input-number>
        </el-form-item>

        <el-form-item label="商品图片" prop="imgUrl">
            <el-upload class="avatar-uploader" :action="BASE_URL + 'http://1.15.179.44:3000/1671239738117.png'" :show-file-list="false"
                :on-success="success" :on-error="error">
                <img :src="BASE_URL + '/goods/goods_img_upload'" class="avatar" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
        <!-- </el-upload>
        </el-form-item> --> -->

        <el-form-item label="商品描述" prop="goodsDesc">
            <el-input placeholder="请描述商品" v-model="data.goodsDesc" />
        </el-form-item>

        <el-form-item>
            <el-button type="primary" @click="submitAdd">确认修改</el-button>
        </el-form-item>
    </el-form>
</template>

<script setup lang="ts">
import { reactive, ref, watch } from 'vue';
import { ElMessage, FormInstance, FormRules } from 'element-plus'
import { doctoreditdoctor } from '../../api/doctor.api'
import router from '@/router';
import type { UploadProps } from 'element-plus'

const BASE_URL = import.meta.env.VITE_IMG_URL

// 定义一个对象
const ruleForm = ref<FormInstance>()

const data = reactive({
    id: 11,
    name: '11',
    idcard: '1111',
    phone: '11',
    department: '11',
})



const submitAdd = () => {
    doctoreditdoctor(data).then(res => {
        console.log(res.data);
        // if (res.data.code === 0) {
        //     ElMessage.success(res.data.msg)
        //     router.push('/goodslist')
        // }
    })
}




</script>

<style scoped lang="scss"></style>